package sch.frog.behavioral.visitor;

import java.util.ArrayList;
import java.util.List;

public class ObjectStruct {

    List<IElement> elements = new ArrayList<>();

    public void add(IElement element){
        elements.add(element);
    }

    public void remove(IElement element){
        elements.remove(element);
    }

    public void pushVisitor(IVisitor visitor){
        for (IElement element : elements){
            element.accept(visitor);
        }
    }

}
